<!DOCTYPE html>
<html>
<head>
    <head>
		<meta charset="UTF-8">
		<title>Insert title here</title>
		<link rel="stylesheet" href="../../css/global.css">
		<link rel="stylesheet" href="../../css/mytable.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../css/dataTables.bootstrap.min.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../layui/css/layui.css">
		<link rel="stylesheet" href="" id='bugcss'>
		<script type="text/javascript">
			document.querySelector('#bugcss').href = '../../layuiadmin/style/bug.css?v=1.0&code=' + new Date();
		</script>
	</head>
</head>
<body>
	<div class="warp">
		<div class="layui-container form-main">
			<div class="layui-row main-title">
				生产人员工作记录
			</div>
			<div>
				<div class="widget-body no-padding">
					<table id="dt-table" class="table table-striped table-bordered table-hover" style="width:100%">
						<thead>
						<tr>
						</tr>
						<tr>
							<th>序号</th>
							<th>任务</th>
							<th>时间</th>
							<th>完成状态</th>
						</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
			<div class="main-operation">
            	<button onclick="location.href='producter_list.html'" class="layui-btn layui-btn my-min-width">返回</button>
            </div>
		</div>
	</div>
</body>
</html>
<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../js/plugin/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../../js/jq.js"></script>
<script type="text/javascript" src="../../js/my/permission.js"></script>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="../../js/dict.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript">
    layui.use([ 'layer' ], function() {
        var layer = layui.layer;
    });
	$(function () {
        init();
    })
    var example;
    function init(){
        var id = getUrlParam("id");
        example =
            $('#dt-table').DataTable({
                "searching": false,
                "processing": false,
                "serverSide" : true,
                "language": {
                    "url": "/js/plugin/datatables/Chinese.lang"
                },
                "ajax": {
                    "url" : "/tTasks/listByProducterId",
                    "type":"get",
                    "data":function(d){
                        d.producter_id = id;
                    },
                    "error":function(xhr, textStatus, errorThrown){
                        var msg = xhr.responseText;
                    }
                },
                "dom": "<'dt-toolbar'r>t<'dt-toolbar-footer'<'col-sm-10 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-10' p v>>",
                "columns": [
                    { "data": "id", "defaultContent": ""},
                    { "data": "content", "defaultContent": ""},
                    { "data": "createTime", "defaultContent": ""},
                    { "data": "state", "defaultContent": "",
                        "render" : function(data,type, row, meta) {
                            if(data == 1) {
                                return '下发成功';
							} else if(data == 2) {
                                return '待审核'
							} else if(data == 3) {
                                return '审核通过'
                            } else if(data == 4) {
                                return '异常'
                            }
                        }}
                ],
                "order": [[ 0, "desc" ],[1, "asc"]]
            } );
    }
</script>
